//
//  HomeHeaderView.m
//  SleepingElf
//
//  Created by karong on 2023/10/10.
//

#import "HomeHeaderView.h"
#import "UIButton+ImageAlign.h"
@interface HomeHeaderView ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIButton *moreBtn;

@end

@implementation HomeHeaderView

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.moreBtn setButtonImageTitleStyle:(GRButtonImageTitleStyleRight) padding:4];
}

- (void)setDataWithTitle:(NSString *)title showMore:(BOOL)showMore {
    self.titleLabel.text = title;
    self.moreBtn.hidden = !showMore;
}

- (IBAction)moreAction:(id)sender {
    if ([self.delegate respondsToSelector:@selector(homeHeaderViewMoreAction:)]) {
        [self.delegate homeHeaderViewMoreAction:self];
    }
}
@end
